import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/UserTable.vue'),
                    meta: { title: '用户列表' }
                },
                {
                    path: '/fee',
                    component: () => import(/* webpackChunkName: "AreaTree" */ '../components/page/FeeManageTable.vue'),
                    meta: { title: '价格管理' }
                },
                {
                    path: '/area',
                    component: () => import(/* webpackChunkName: "AreaTree" */ '../components/page/AreaTree.vue'),
                    meta: { title: '运费管理' }
                },
                {
                    path: '/banner',
                    component: () => import(/* webpackChunkName: "banner" */ '../components/page/BannerTable.vue'),
                    meta: { title: '轮播图管理' }
                },
                {
                    path: '/notice',
                    component: () => import(/* webpackChunkName: "notice" */ '../components/page/NoticeTable.vue'),
                    meta: { title: '公告管理' }
                },
                {
                    path: '/demand',
                    component: () => import(/* webpackChunkName: "demand" */ '../components/page/DemandTable.vue'),
                    meta: { title: '需求管理' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/MarkdownTabs.vue'),
                    meta: { title: '其他设置' }
                },
                {
                    path: '/dict',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/DictManage.vue'),
                    meta: { title: '数据字典' }
                },
                {
                    path: '/qusetion',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/QuestionTable.vue'),
                    meta: { title: '用户反馈' }
                },
                {
                    // 国际化组件
                    path: '/fourm',
                    component: () => import('../components/page/ForumTable.vue'),
                    meta: { title: '用户论坛' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});